package com.training.file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileReadandWrite {

	public static void main(String[] args) throws Exception {

		String fromFileName = "C:\\FaceProv.log";

		String toFileName = "C:\\Anjali\\workFaceProv_Test.log";
		
		File toFile  = new File(toFileName);
		
		if(!toFile.exists())
		{
			toFile.createNewFile();
		}

		FileInputStream fileInputStream = new FileInputStream(fromFileName);

		FileOutputStream fileOutputStream = new FileOutputStream(toFile);

		byte[] buff = new byte[32 * 1024];

		int len;

		while ((len = fileInputStream.read(buff)) > 0) {
			
			fileOutputStream.write(buff, 0, len);

		}
		fileInputStream.close();
		fileOutputStream.close();
	}
}
